import province from "./province.js"
import city from "./city.js"
import area from "./area.js"

function codeToText(arr){
	let array1 = arr[0];
	let array2 = arr[1];
	let array3 = arr[2];
	let res = [];
	
	province.forEach((v,i,arr)=>{
		if(v.value == array1){
			res.push(v.label);
		}
	});
	
	city.forEach((v,i,arr)=>{
		v.forEach((v2,i2,arr2)=>{
			if(v2.value == array2){
				res.push(v2.label);
			}
		});
	});
	
	area.forEach((v,i,arr)=>{
		v.forEach((v2,i2,arr2)=>{
			v2.forEach((v3,i3,arr3)=>{
				if(v3.value == array3){
					res.push(v3.label);
				}
			});
		});
	});
	
	return res;
}

export default codeToText;